package controller;

import java.util.Map;

/**
 * The Notification class encapsulates name, sender and an optional Map of arbitrary user info.
 * Classes that subscribe to a particular Notification may query the Notification
 * for its name. The sender instance variable allows interaction with the object
 * that issued this Notification. Additional data may optionally be delivered via
 * the userInfo Map.
 * @author nils
 *
 */
public class Notification {
	
	// A few predefined notification string constants:
	public final static String didFindEdgeIn = "did find edgeIn";
	public final static String didFinishMWT = "did finish MWT";
	public final static String didTriangulatePolygon = "did triangulate polygon";
	public final static String didTerminateTriangulator = "did terminate triangulator";
	public final static String willStartProcessing = "will start processing";
	public final static String didProcessXPercent = "did process x percent";
	public final static String didFindCircles = "did find circles";
	
	public String name;
	public Object sender;
	public Map<String, Object> userInfo;
	
	public Notification(String name, Object sender, Map<String, Object> userInfo) {
		this.name = name;
		this.sender = sender;
		this.userInfo = userInfo;
	}
}
